package Circle;

public class Test {
    public static void main(String[] args) {
        Circle cr = new Circle(5.0);
        cr.length();
        cr.area();
    }
}

class Circle{
    double r;//半径
    double pi = 3.14;
    public Circle(double r){
        this.r = r;
    }

    public void length(){
        double length = this.r * pi * 2;
        System.out.printf("圆的周长为：%.2fCM\n",length);
    }

    public void area(){
        double area = this.r * this.r * pi;
        System.out.printf("圆的面积为:%.2fCM\n",area);
    }
}